package com.sk.restree.model.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.sk.restree.model.dto.MenuDTO;
import com.sk.restree.model.ibatis.SqlMapFactory;

public class MenuDAO {
	private static MenuDAO instance;
	private SqlMapClient sqlMap;

	static {
		instance = new MenuDAO();
	}

	private MenuDAO() {
		sqlMap = SqlMapFactory.getSqlMapInstance();
	}

	public static MenuDAO getInstance() {
		return instance;
	}

	@SuppressWarnings("unchecked")
	public List<MenuDTO> getMenuList(String store_id) {
		List<MenuDTO> list = null;
		try {
			list = sqlMap.queryForList("selectMenuList", store_id);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list;
	}
}
